<div class="row">

    <div class="col-md-12">

        <?php


        Yii::app()->clientScript->registerScript('search', "
				$('.search-button').click(function(){
					$('.search-form').toggle();
					return false;
				});
				$('.search-form form').submit(function(){
					$('#category-grid').yiiGridView('update', {
						data: $(this).serialize()
					});
					return false;
				});
				");
        ?>

        <h1>Manage Categories</h1>

        <p>
            You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>
                &lt;&gt;</b>
            or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
        </p>


        <?php
        echo CHtml::button('Create Category', array('submit' => array('/Category/create'), 'class' => 'btn btn-primary'));
        ?>


        <?php $this->widget('zii.widgets.grid.CGridView', array(
            'id' => 'category-grid',
            'dataProvider' => $model->search(),
            'filter' => $model,
            'columns' => array(
                array(
                    'header' => 'No',
                    'value' => '$this->grid->dataProvider->pagination->currentPage * $this->grid->dataProvider->pagination->pageSize + ($row+1)',
                ),
                'title',
                'description',
                array(
                    'class' => 'CButtonColumn',
                    'htmlOptions' => array('style' => 'width:80px')
                ),
            ),
        )); ?>
    </div>

</div>